package com.jm.controller;

import com.jm.model.Account;
import com.jm.service.AccountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/account")
@Slf4j
public class AccountController {

    @Resource
    private AccountService accountService;

    @PostMapping("/decAccount")
    void decreaseAccount(@RequestBody Account account) {
        log.info("请求账户微服务：{}", account.toString());
        accountService.decAccount(account);
    }
}

